package com.vint.leetcode;

/*
 *
 */
public class Leetcode657 {
    public boolean judgeCircle(String moves) {
        if(null==moves || moves.length()==0){
            return true;
        }
        int l, r, u, d;
        l = r = u = d = 0;
        char[] src = moves.toCharArray();
        for(char c : src){
            if(c=='L')l++;
            if(c=='R')r++;
            if(c=='U')u++;
            if(c=='D')d++;
        }
        if(l==r&&u==d){
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
    }
  }
